﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Generate.aspx.cs" Inherits="_Default" MasterPageFile="~/MasterPage.master" EnableEventValidation="false" Title="Generate Resources &raquo; ResourceBlender" %>

<asp:Content ID="contentHead" ContentPlaceHolderID="head" Runat="Server">
    <title>Generate Resources</title>
</asp:Content>

<asp:Content ID="contentMain" ContentPlaceHolderID="cntMain" runat="server">
    <form id="frmGenerate" runat="server">
    <asp:ScriptManager ID="scrUpdateLanguages" runat="server"></asp:ScriptManager>
    <h1 id="generateHeader">Generate Resources</h1>
    <asp:MultiView ID="mltNoApplications" runat="server" ActiveViewIndex="0">
        <asp:View ID="viwNoApps" runat="server">
            <p>You must <asp:HyperLink ID="lnkAddApplication" runat="server" Text="add an application" NavigateUrl="~/Applications.aspx">add an application</asp:HyperLink> before generating resources.</p>
        </asp:View>
        <asp:View ID="viwGenerate" runat="server">
            <fieldset>
                <legend>Select Components</legend>
                <asp:UpdatePanel ID="updRadApplication" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div class="componentholder">
                            <label class="block">Application</label>
                            <asp:RadioButtonList ID="radApplication" runat="server" RepeatLayout="Flow" 
                                                 onselectedindexchanged="ShowLanguages" 
                                AutoPostBack="True" CssClass="plain"></asp:RadioButtonList>
                        </div>
                        <div class="componentholder">
                            <asp:Label ID="lblBundleName" runat="server" Text="Form name" 
                                AssociatedControlID="lstBundles" CssClass="block"></asp:Label>
                            <asp:ListBox ID="lstBundles" runat="server" SelectionMode="Multiple" 
                                         Rows="10"></asp:ListBox>
                        </div>
                        <div class="componentholder">
                            <label class="block">Languages</label>
                            <asp:ListBox ID="lstLanguages" runat="server" SelectionMode="Multiple" 
                                         Rows="10"></asp:ListBox>
                        </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="radApplication" 
                                                  EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
                <asp:UpdateProgress ID="prgRadApplication" runat="server" 
                                    AssociatedUpdatePanelID="updRadApplication" 
                                    DisplayAfter="100">
                    <ProgressTemplate>
                        <div class="centered"><asp:Image ID="imgLoadingLanguages" runat="server" ImageUrl="~/images/ajax-loader.gif" AlternateText="Loading Languages..." /></div>
                    </ProgressTemplate>
                </asp:UpdateProgress>
                <div class="clear">&nbsp;</div>
            </fieldset>
            <fieldset>
                <legend>Options</legend>
                <asp:Label ID="lblThreshold" runat="server" Text="Completion Threshold (Percent)"></asp:Label>
                <asp:TextBox ID="txtThreshold" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="requiredThreshold" runat="server" 
                                            ErrorMessage="You must enter the completion threshold" 
                                            ControlToValidate="txtThreshold" 
                                            CssClass="error" 
                                            Display="Dynamic">
                </asp:RequiredFieldValidator>
                     
                <br />
                <asp:CheckBox ID="chkIncludeSummary" runat="server" Checked="True" 
                              Text="Include Summary" />
            </fieldset>
            
            <asp:Button ID="btnResources" runat="server" Text="Generate Resources" 
                PostBackUrl="GenerateResources.aspx" />
            <br />
        </asp:View>
    </asp:MultiView>
    </form>
</asp:Content>